<?php
declare (strict_types = 1);

namespace app\admin\controller;
use \think\facade\Db;
use \think\facade\View;
use \think\facade\Request;
class Index
{

    public function index()
    {
        return view();
    }

    public function info()
    {

        $info=\app\admin\model\Program::getinfo();
        View::assign('info',$info);

        return view('info');

    }

    public function pass()
    {
        return view('pass');
    }

    public function adv()
    {
        $adv=\app\admin\model\Banner::getBanner();
        View::assign('adv',$adv);
        return view('adv');
    }
    public function brand()
    {
        //接POST数据所有的值
        $post=Request::post();
        //批量赋值 可以按键输出 进行留置
        view::assign($post);
        //拼装搜索条件
        $where=[];
        if(isset($post['keywords'])&& $post['keywords']<> '')     $where['keywords']=$post['keywords'];
        if(isset($post['if_show']) && count($post['if_show'])==1) $where['if_show']=$post['if_show'];
        if(isset($post['recommended']) && $post['recommended'] <> '')     $where['recommended']=$post['recommended'];


        $brand=\app\admin\model\Brand::getBrand($where);


        View::assign('brand',$brand);
        return view('brand');
    }


}
